package com.hanbang.chu_xing_gao_zhao.view_pay;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;

import com.hanbang.chu_xing_gao_zhao.base.BaseActivity;
import com.hanbang.cxgz_2.R;

public class EsotericaPayActivity extends BaseActivity {
    private CheckBox zfb;
    private CheckBox wx;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.esoterica_pay);
        initView();
        setOnClickListener();
    }

    /**
     * 初始化view
     */
    private void initView() {
        setTitleMore(View.VISIBLE, View.INVISIBLE, "订单支付", null, null, null);
        setBackArrows(findViewById(R.id.bar_top_conver_classify_back));

        zfb = (CheckBox) findViewById(R.id.cb_esoterica_pay_zfb);
        zfb.setSelected(true);
        wx = (CheckBox) findViewById(R.id.cb_esoterica_pay_wx);

    }

    /**
     * 设置点击事件
     */
    private void setOnClickListener() {
        zfb.setOnClickListener(onClickListener);
        wx.setOnClickListener(onClickListener);

    }

    /**
     * 处理监听
     */
    @SuppressWarnings("unused")
    private OnClickListener onClickListener = new OnClickListener() {

        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.cb_esoterica_pay_zfb:
                    wx.setSelected(false);
                    zfb.setSelected(true);
                    break;
                case R.id.cb_esoterica_pay_wx:
                    wx.setSelected(true);
                    zfb.setSelected(false);
                    break;

                default:
                    break;
            }
        }
    };

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
    }

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
    }
}
